package banking8.domain;

import banking8.domain.Customer;

/**
 * Created with IntelliJ IDEA
 * Description:
 * User:恋恋
 * Date:2022-11-08
 * Time:22:50
 */
public class Bank {
    banking8.domain.Customer[] customers;
    int numberOfCustomer;
    //Bank构造器也应该是私有的
    private Bank(banking8.domain.Customer[] customers) {
        this.customers = customers;
    }
    public void addCustomer(String firstName,String lastName){
        banking8.domain.Customer customer=new banking8.domain.Customer(firstName,lastName);
        customers[numberOfCustomer]=customer;
        numberOfCustomer++;
    }
    public int getNumberOfCustomer() {
        return numberOfCustomer;
    }

    public banking8.domain.Customer getCustomer(int i){
        return customers[i];
    }
    // 修改 Bank 类，创建名为 getBanking 的公有静态方法，它返回一个 Bank类的实例。
    public static banking8.domain.Bank getBank(){
        return new banking8.domain.Bank(new Customer[10]);
    }
}
